package office.poi.excel.utils;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFSheet;

public class RowUtils {
	  /**
	   * 根据行内容得到行索引
	   * @param sheet
	   * @param rowName
	   * @return
	   */
	  public static int[] getRowIndex(HSSFSheet sheet,String rowName)
	  {
		  List<HSSFCell> list =  CellUtils.findCell(sheet,rowName);
		  int[] index = new int[list.size()]; 
		  try{ 
			 for (int i = 0; i < list.size(); i++) {
				 index[i] = list.get(i).getRowIndex();
			}
		  }catch (Exception e) {
		}
		  return index;	 
	  }
	 
}
